{% extends 'dashboard/layout.html' %}
{% load dashboard_tags %}
{% load i18n %}
{% load render_table from django_tables2 %}

{% block body_class %}{{ block.super }} users{% endblock %}

{% block title %}
    {% trans "Customers" %} | {{ block.super }}
{% endblock %}

{% block header %}
    <div class="page-header">
        <h1>{% trans "Customers" %}</h1>
    </div>
{% endblock header %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        </li>
        <li class="active">{% trans "Customers" %}</li>
    </ul>
{% endblock %}

{% block dashboard_content %}
    <div class="table-header">
        <h3><i class="icon-search icon-large"></i> {% trans "Search" %}</h3>
    </div>
    <div class="well">
        <form action="." method="get" class="form-inline">
            {% include "dashboard/partials/form_fields_inline.html" with form=form %}
            <button type="submit" name="search" class="btn btn-primary" data-loading-text="{% trans 'Searching...' %}">{% trans "Search" %}</button>
            <a href="{% url 'dashboard:users-index' %}" class="btn btn-default">{% trans "Reset" %}</a>
        </form>
    </div>

    {% block users_list %}
        {% if users.data %}
          <form id="user_list_form" action="." method="post" class="form-inline">
            {% csrf_token %}
            {% render_table users %}
          </form>
        {% else %}
            <table class="table table-striped table-bordered table-hover">
                <caption>{{ queryset_description }}</caption>
                <tr><td>{% trans "No customers found." %}</td></tr>
            </table>
        {% endif %}
    {% endblock %}

{% endblock dashboard_content %}
